package org.fastiot.protocol

class Data extends Packet {

    static class Reply {
        Boolean enable
        Integer packetCode
        String hexPacketCode

        static constraints = {
            enable(nullable: false)
            packetCode(nullable: true, min: 0, display: false)
            hexPacketCode(blank: true, matches: /0-9a-fA-F/)
        }
    }

    Boolean reissued
    Reply reply

    static embedded = ['reply']

    static constraints = {
        reissued(nullable: false)
        reply(nullable: false)
    }

    static mapping = {
        table "packet_data"
    }
}
